package routefinder.module;

public class Edge {
	private Vertex a;
	private Vertex b;
	private double cost;
	private boolean visited;

	public Edge() {
		this.a = null;
		this.b = null;
		this.cost = 0;
		this.visited = false;
	}

	public Edge(Vertex a, Vertex b, double cost) {
		this.a = a;
		this.b = b;
		this.cost = cost;
		this.visited = false;
	}
	
	public Vertex getA() { return this.a; }
	public Vertex getB() { return this.b; }
	public double getCost() { return this.cost; }
	public void setA(Vertex a) { this.a = a; }
	public void setB(Vertex b) { this.b = b; }
	public void setCost(int cost) { this.cost = cost; }
	public void visited(boolean b) { this.visited = b; }
	public boolean visited() { return this.visited; }
	public boolean equals(Edge e) {
		return (((e.getA().equals(this.a)) && (e.getB().equals(this.b)) && (e.getCost() == this.cost))
			|| ((e.getA().equals(this.b)) && (e.getB().equals(this.a)) && (e.getCost() == this.cost)));
	}
	// Data structure representing an edge(path)
}

